<head>
	<script>
	function write_save()
	{
	    var f = document.bWriteForm;
	
	    if(f.b_title.value == ""){
	        alert("글제목을 입력해 주세요.");
	        return false;
	    }
	
	    if(f.b_contents.value == ""){
	        alert("글내용을 입력해 주세요.");
	        return false;
	    }
	
	    f.submit();
	
	}
	</script>
</head>
<?php
    
    require("./include.php");
	
	if(!$_SESSION[user_id]){
		?>
		<script>
			alert("로그인 하셔야 합니다");
			location.replace("board_login.php");
		</script>
		<?
	}
?>
<br/>
<table style="width:1000px;height:50px;border:5px #CCCCCC solid;">
    <tr>
        <td align="center" valign="middle" style="font-zise:15px;font-weight:bold;">글쓰기</td>
    </tr>
</table>
<br/>
<form name="bWriteForm" method="post" action="./board_write_save.php" style="margin:0px;">
<table style="width:1000px;height:50px;border:0px;">
    <tr>
        <td align="center" valign="middle" style="width:200px;height:50px;background-color:#CCCCCC;">글제목</td>
        <td align="left" valign="middle" style="width:800px;height:50px;"><input type="text" name="b_title" style="width:780px;"></td>
    </tr>
    <tr>
        <td align="center" valign="middle" style="width:200px;height:200px;background-color:#CCCCCC;">글내용</td>
        <td align="left" valign="middle" style="width:800px;height:200px;">
        <textarea name="b_contents" style="width:800px;height:200px;"></textarea>
        </td>
    </tr>
    <!-- 4. 글쓰기 버튼 클릭시 입력필드 검사 함수 write_save 실행 -->
    <tr>
        <td align="center" valign="middle" colspan="2"><input type="button" value=" 글쓰기 " onClick="write_save();"></td>
    </tr>
</table>
</form>